package com.cloudcentral.feign;

import com.cloudcentral.entity.dto.SMSCodeDTO;
import com.cloudcentral.feign.fallback.ToolkitFeignFallback;
import com.cloudcentral.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * Create by Administrator
 * 2023/11/1 10:19
 */
@FeignClient(name = "toolkit", fallbackFactory = ToolkitFeignFallback.class)
public interface ToolkitFeign {
  @PostMapping("/sms/code")
  Result<Boolean> code(SMSCodeDTO dto) throws Exception;

  @PostMapping("/file/uploadPCM")
  Result<String> uploadPCM(@RequestParam String pcm) throws Exception;

  @PostMapping("/file/uploadCSV")
  Result<String> uploadCSV(@RequestParam String content) throws Exception;

  @PostMapping("/file/uploadFile")
  Result<String> uploadFile(@RequestParam String type, @RequestPart MultipartFile file) throws Exception;

  @DeleteMapping("/file/delete")
  Result<Boolean> delete(String uri) throws Exception;
}
